package asteroids;

import java.util.Random;

import com.uqbar.vainilla.appearances.Sprite;

public class BigAsteroid extends Asteroid {
	
	public BigAsteroid(int x,int y) {
		super(x,y);
		this.setAppearance(Sprite.fromImage("/images/asteroidBig01.png").scale(2));
	}
	
	@Override
	public void onSceneActivated() {
		Random random = new Random(); 
		double i = random.nextInt(10);
		double j = random.nextInt(10);
		//para variar el movimiento de los asteroides
		if(i%2==0)
			i=-i;
		if(j%2==0)
			j=-j;
		this.getVector().setLocation(i,j);	
		this.setSpeed(random.nextInt(this.getMAXSPEED()));
		super.onSceneActivated();
	}

	@Override
	public void shooted() {
		this.getLevel().addAsteroid(new MidAsteroid(this));
		this.getLevel().addAsteroid(new MidAsteroid(this));
		this.destroy();
	}

}
